<?php
/**
 * Created by PhpStorm.
 * User: 17464
 * Date: 2020/1/6
 * Time: 17:07
 */

namespace App\Models;

class SendGroupSmsLog extends BaseModel
{
    /**
     * 关联到模型的数据表
     *
     * @var string
     */
    protected $table = 'send_group_sms_log';

    /**
     * 发送验证码的用户
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function smsLogUser(){
        return $this->hasOne(User::class, 'phone', 'phone');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function smsGroupLog(){
        return $this->belongsTo(SendGroupSms::class, 'group_sms_id', 'id');
    }
}
